function install_base_command() {
    yum install -y jq zip unzip curl tree wget vim telnet
}

# 修改yum镜像源
function install_yum_source(){
  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak


  mkdir -p /etc/yum.repos.d.bak && mv /etc/yum.repos.d/* /etc/yum.repos.d.bak/
  wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  wget -O /etc/yum.repos.d/epel.repo        http://mirrors.aliyun.com/repo/epel-7.repo
#  cp epel.repo /etc/yum.repos.d/
  yum makecache
}



# ifconfig 有网卡信息，但是 /etc/sysconfig/network-scripts 目录下没有对应的配置文件时
function network_config_not_found() {
#    查看网卡配置信息
    nmcli con show
#    生成网卡信息， 这里的 ens224 是网卡名称，根据自己网卡名称修改
    nmcli con add con-name ens224 type ethernet ifname ens224
#    最后重启network
    systemctl restart network
}


# 安装 RPM-GPG-KEY-EPEL-7 公钥
function install_RPM_GPG_KEY_EPEL_7() {
    curl https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 > /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
}

# 自动补齐命令
function bash_completion() {
    # yum install -y epel-release # 这行根据实际情况是否执行
    yum install -y bash-completion bash-completion-extras
    #find / -name bash_completion.sh
    #/etc/profile.d/bash_completion.sh
    source /etc/profile
}
